package com.bangcommunity.bbframe.sdm.web.shiro.stateless;

import com.bangcommunity.bbframe.sdm.web.shiro.ISdmPemissionService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.Serializable;

/**
 * @Author tanghc
 * @Date 17/11/16
 */
public class SdmUidTokenStatelessAuthcAuthrizeFilter<PK extends Serializable>
extends SdmUidTokenStatelessAuthcFilter<PK>  {
    @Autowired(required = false)
    private ISdmPemissionService sdmPemissionService;
    protected boolean hasPermition( ServletRequest request, ServletResponse response){
        return sdmPemissionService.hasPermition( (HttpServletRequest) request, (HttpServletResponse) response,((HttpServletRequest) request).getRequestURI());
    }
}
